<template>
  <section>
    <div class="nomedrecord">
      <img src="../../assets/medical.png" alt="" width="200px" v-if="ifLoading">
      <p ref="message" style="height:90px;line-height:90px;font-size: 14px;font-weight: bold;color: gray;"></p>
    </div>
  </section>
</template>

<script>
  import {Indicator  } from "mint-ui";
  import {getUserList} from "../../api/api"
  export default {
        props: [],
        name: 'app',
        data(){
            return {
              ifLoading:false
            }
        },
        computed: {},
        components: {},
        created(){
        },
        methods: {
          getUserList(){
            Indicator.open({
              spinnerType: 'fading-circle'
            });
            getUserList({
              UserId:JSON.parse(localStorage.getItem("user")).Id,
              Name:"",
              PageSize:100,
              CurrentPage:1,
            }).then(res=>{
              Indicator.close();
              console.log(res.data.Result[0].ApprovalStatus);
              if(res.data.Result[0].ApprovalStatus==0){//未认证
                this.$router.replace("/doctorinformation");
              }
              else  if(res.data.Result[0].ApprovalStatus==1){//待认证
                this.ifLoading=true;
                this.$refs.message.innerHTML="还在审核中，请耐心等待";
              }
              else  if(res.data.Result[0].ApprovalStatus==2){//已通过
                this.$router.replace("/doctorinformation");
              }
              else  if(res.data.Result[0].ApprovalStatus==3){//失败
                this.ifLoading=true;
                this.$refs.message.innerHTML="审核失败，请联系管理员";
              }
            });
          }
        },
        mounted() {
             this.getUserList();

        },
        destroyed(){
        }
    }
</script>

<style lang="scss" scoped>
  section{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 600px;
  }
</style>
